/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package autodiarydataprocess;

/**
 *
 * @author kkkkkkkkkkkk
 */
public class test {
    public static void main(String[] args) {
        // TODO code application logic here
        float n1 = (float) 19.3;
        float n2 = (float) 3.5;
        float diff = n1 - n2;
        int roundDiff = Math.round(diff);
        
        if (roundDiff < 0) {roundDiff = 0;}
        if (roundDiff > 15){roundDiff = 15;}
        
        System.out.println("Float diff: " + diff + ", round diff: " + roundDiff);
        
        String strDiff = Long.toBinaryString(Long.parseLong(String.valueOf(roundDiff)));
        System.out.println("Binary of " + roundDiff + " is: " + strDiff);
    }
}

